r_asm_sources = [
  'asm.c',
  'aop.c',
  'acode.c',
  'p/asm_6502.c',
  'p/asm_6502_cs.c',
  'p/asm_8051.c',
  'p/asm_amd29k.c',
  'p/asm_arc.c',
  'p/asm_arm_as.c',
  'p/asm_arm_cs.c',
  'p/asm_arm_gnu.c',
  'p/asm_arm_winedbg.c',
  'p/asm_avr.c',
  'p/asm_bf.c',
  'p/asm_chip8.c',
  'p/asm_cr16.c',
  'p/asm_cris_gnu.c',
  'p/asm_dalvik.c',
  'p/asm_dcpu16.c',
  'p/asm_ebc.c',
  #'p/asm_gas.c',
  'p/asm_gb.c',
  'p/asm_h8300.c',
  'p/asm_hexagon.c',
  #'p/asm_hexagon_gnu.c',
  'p/asm_hppa_gnu.c',
  'p/asm_i4004.c',
  'p/asm_i8080.c',
  'p/asm_java.c',
  'p/asm_lanai_gnu.c',
  'p/asm_lh5801.c',
  'p/asm_lm32.c',
  'p/asm_m68k_cs.c',
  'p/asm_m680x_cs.c',
  'p/asm_malbolge.c',
  'p/asm_mcs96.c',
  'p/asm_mips_cs.c',
  'p/asm_mips_gnu.c',
  'p/asm_msp430.c',
  'p/asm_nios2.c',
  'p/asm_or1k.c',
  'p/asm_pic.c',
  'p/asm_mcore.c',
  'p/asm_ppc_cs.c',
  'p/asm_ppc_gnu.c',
  'p/asm_propeller.c',
  'p/asm_pyc.c',
  'p/asm_riscv.c',
  'p/asm_rsp.c',
  'p/asm_sh.c',
  'p/asm_snes.c',
  'p/asm_sparc_cs.c',
  'p/asm_sparc_gnu.c',
  'p/asm_spc700.c',
  'p/asm_sysz.c',
  'p/asm_tms320.c',
  'p/asm_tms320c64x.c',
  'p/asm_tricore.c',
  'p/asm_v810.c',
  'p/asm_v850.c',
  'p/asm_vax.c',
  'p/asm_wasm.c',
  'p/asm_ws.c',
  'p/asm_x86_as.c',
  'p/asm_x86_cs.c',
  'p/asm_x86_nasm.c',
  'p/asm_x86_nz.c',
  #'p/asm_x86_vm.c',
  'p/asm_xap.c',
  'p/asm_xcore_cs.c',
  'p/asm_xtensa.c',
  'p/asm_z80.c',
  #'arch/6502/6502dis.c',
  'arch/amd29k/amd29k.c',
  #'arch/8051/8051_disas.c',
  'arch/8051/8051_ass.c',
  'arch/arc/gnu/arc-dis.c',
  'arch/arc/gnu/arc-ext.c',
  'arch/arc/gnu/arc-opc.c',
  'arch/arc/gnu/arcompact-dis.c',
  'arch/arm/aarch64/aarch64-dis-2.c',
  'arch/arm/aarch64/aarch64-dis.c',
  'arch/arm/aarch64/aarch64-opc-2.c',
  'arch/arm/aarch64/aarch64-opc.c',
  'arch/arm/armass.c',
  'arch/arm/armass64.c',
  'arch/arm/gnu/arm-dis.c',
  'arch/arm/gnu/floatformat.c',
  'arch/arm/winedbg/be_arm.c',
  #'arch/avr/avr_disasm.c',
  #'arch/avr/disasm.c',
  'arch/cr16/cr16_disas.c',
  'arch/cris/gnu/cris-dis.c',
  'arch/cris/gnu/cris-opc.c',
  #'arch/dcpu16/asm.c',
  #'arch/dcpu16/dis.c',
  #'arch/dcpu16/main.c',
  'arch/ebc/ebc_disas.c',
  #'arch/gb/gbasm.c',
  #'arch/gb/gbdis.c',
  'arch/h8300/h8300_disas.c',
  'arch/hexagon/hexagon.c',
  'arch/hexagon/hexagon_disas.c',
  #'arch/hexagon/gnu/hexagon-dis.c',
  #'arch/hexagon/gnu/hexagon-opc.c',
  #'arch/hexagon/gnu/safe-ctype.c',
  'arch/hppa/gnu/hppa-dis.c',
  #'arch/i4004/i4004dis.c',
  #'arch/i8080/i8080dis.c',
  'arch/lanai/gnu/lanai-dis.c',
  'arch/lanai/gnu/lanai-opc.c',
  'arch/mips/gnu/mips-dis.c',
  'arch/mips/gnu/mips-opc.c',
  'arch/mips/gnu/mips16-opc.c',
  'arch/mips/mipsasm.c',
  'arch/msp430/msp430_disas.c',
  'arch/nios/gnu/nios2-dis.c',
  'arch/nios/gnu/nios2-opc.c',
  'arch/or1k/or1k_disas.c',
  'arch/pic/pic_baseline.c',
  'arch/pic/pic_midrange.c',
  'arch/pic/pic_pic18.c',
  'arch/mcore/mcore.c',
  'arch/ppc/gnu/ppc-dis.c',
  'arch/ppc/gnu/ppc-opc.c',
  'arch/ppc/libvle/vle.c',
  'arch/ppc/libps/libps.c',
  'arch/propeller/propeller_disas.c',
  'arch/pyc/opcode_10.c',
  'arch/pyc/opcode_11.c',
  'arch/pyc/opcode_12.c',
  'arch/pyc/opcode_13.c',
  'arch/pyc/opcode_14.c',
  'arch/pyc/opcode_15.c',
  'arch/pyc/opcode_16.c',
  'arch/pyc/opcode_20.c',
  'arch/pyc/opcode_21.c',
  'arch/pyc/opcode_22.c',
  'arch/pyc/opcode_23.c',
  'arch/pyc/opcode_24.c',
  'arch/pyc/opcode_25.c',
  'arch/pyc/opcode_26.c',
  'arch/pyc/opcode_27.c',
  'arch/pyc/opcode_2x.c',
  'arch/pyc/opcode_30.c',
  'arch/pyc/opcode_31.c',
  'arch/pyc/opcode_32.c',
  'arch/pyc/opcode_33.c',
  'arch/pyc/opcode_34.c',
  'arch/pyc/opcode_35.c',
  'arch/pyc/opcode_36.c',
  'arch/pyc/opcode_37.c',
  'arch/pyc/opcode_38.c',
  'arch/pyc/opcode_39.c',
  'arch/pyc/opcode_3x.c',
  'arch/pyc/opcode_anal.c',
  'arch/pyc/opcode_arg_fmt.c',
  'arch/pyc/opcode.c',
  'arch/pyc/pyc_dis.c',
  #'arch/riscv/riscv-opc.c',
  #'arch/riscv/riscv.c',
  'arch/rsp/rsp_idec.c',
  'arch/sh/gnu/sh-dis.c',
  #'arch/snes/snesdis.c',
  'arch/sparc/gnu/sparc-dis.c',
  'arch/sparc/gnu/sparc-opc.c',
  #'arch/spc700/spc700dis.c',
  'arch/tms320/c55x_plus/c55plus.c',
  'arch/tms320/c55x_plus/c55plus_decode.c',
  'arch/tms320/c55x_plus/decode_funcs.c',
  'arch/tms320/c55x_plus/hashtable.c',
  #'arch/tms320/c55x_plus/hashvector.c',
  'arch/tms320/c55x_plus/ins.c',
  'arch/tms320/c55x_plus/utils.c',
  'arch/tms320/tms320_dasm.c',
  'arch/tricore/gnu/cpu-tricore.c',
  'arch/tricore/gnu/tricore-dis.c',
  'arch/tricore/gnu/tricore-opc.c',
  'arch/v810/v810_disas.c',
  'arch/v850/v850_disas.c',
  'arch/vax/vax-dis.c',
  'arch/wasm/wasm.c',
  'arch/whitespace/wsdis.c',
  #'arch/xap/dis.c',
  'arch/xtensa/gnu/elf32-xtensa.c',
  'arch/xtensa/gnu/xtensa-dis.c',
  'arch/xtensa/gnu/xtensa-isa.c',
  'arch/xtensa/gnu/xtensa-modules.c',
  #'arch/z80/expressions.c',
  'arch/z80/z80.c',
  #'arch/z80/z80asm.c',
]

r_asm_inc = [
  platform_inc,
  include_directories(
    '../../shlr',
    'arch/include',
    'arch',
    'arch/h8300',
    'arch/hexagon',
    'arch/msp430',
    'arch/rsp',
    'arch/mcore',
    'arch/v850',
    'arch/propeller',
    'arch/ebc',
    'arch/cr16',
    'arch/8051',
    'arch/v810',
    'arch/or1k'
  )
]

r_asm = library('r_asm', r_asm_sources,
  include_directories: r_asm_inc,
  c_args: library_cflags,
  dependencies: [
    r_util_dep,
    r_syscall_dep,
    r_parse_dep,
    r_lang_dep,
    r_flag_dep,
    r_socket_dep,
    capstone_dep,
    java_dep
  ],
  install: true,
  implicit_include_directories: false,
  soversion: r2_libversion
)

r_asm_dep = declare_dependency(link_with: r_asm,
                               include_directories: r_asm_inc)

pkgconfig_mod.generate(r_asm,
  subdirs: 'libr',
  version: r2_version,
  name: 'r_asm',
  filebase: 'r_asm',
  libraries: pkgcfg_sanitize_libs,
  requires: [
    'r_util',
    'r_syscall',
    'r_parse',
    'r_lang',
    'r_flag',
    'r_socket'
  ],
  description: 'radare foundation libraries'
)
